package com.sparrow.example_message.backpack.req;

import java.io.Serializable;

import com.baidu.bjf.remoting.protobuf.*;

import java.util.*;

import com.sparrow.example_message.backpack.req.ReqBackPackUseGoods;

import com.baidu.bjf.remoting.protobuf.FieldType;

import com.baidu.bjf.remoting.protobuf.utils.*;

import com.google.protobuf.*;

import java.io.IOException;

import java.lang.reflect.*;

import com.baidu.bjf.remoting.protobuf.code.*;


public class ReqBackPackUseGoods$$JProtoBufClass implements com.baidu.bjf.remoting.protobuf.Codec<com.sparrow.example_message.backpack.req.ReqBackPackUseGoods>, Serializable {
	public static final long serialVersionUID = 1L;
    private com.google.protobuf.Descriptors.Descriptor descriptor;

    public byte[] encode(com.sparrow.example_message.backpack.req.ReqBackPackUseGoods t) throws IOException {
        CodecOutputByteArray output = CodecOutputByteArray.get();
        doWriteTo(t, output.getCodedOutputStream());
        return output.getData();
    }

    public com.sparrow.example_message.backpack.req.ReqBackPackUseGoods decode(byte[] bb) throws IOException {
        CodedInputStream input = CodedInputStream.newInstance(bb, 0, bb.length);
        return readFrom(input);
    }

    public int size(com.sparrow.example_message.backpack.req.ReqBackPackUseGoods t) throws IOException {
        int size = 0;
        
        Long f_1 = null;
        if (!CodedConstant.isNull(t.getGoodsId())) {
            f_1 = t.getGoodsId();  
            size += com.google.protobuf.CodedOutputStream.computeInt64Size(1,f_1.longValue());

        }
        
        
        Integer f_2 = null;
        if (!CodedConstant.isNull(t.getNum())) {
            f_2 = t.getNum();  
            size += com.google.protobuf.CodedOutputStream.computeInt32Size(2,f_2.intValue());

        }
        
        
        return size;
    }
 
    public void doWriteTo(com.sparrow.example_message.backpack.req.ReqBackPackUseGoods t, CodedOutputStream output)
            throws IOException {
         
        Long f_1 = null;
        if (!CodedConstant.isNull(t.getGoodsId())) {
            f_1 = t.getGoodsId();
            if (f_1 != null){
output.writeInt64(1, f_1.longValue());
}
  
        }
        
        Integer f_2 = null;
        if (!CodedConstant.isNull(t.getNum())) {
            f_2 = t.getNum();
            if (f_2 != null){
output.writeInt32(2, f_2.intValue());
}
  
        }
        
    }            
 
    public void writeTo(com.sparrow.example_message.backpack.req.ReqBackPackUseGoods t, CodedOutputStream output)
            throws IOException {
        doWriteTo(t, output);
    }
 
    public com.sparrow.example_message.backpack.req.ReqBackPackUseGoods readFrom(CodedInputStream input) throws IOException {
        com.sparrow.example_message.backpack.req.ReqBackPackUseGoods ret = new com.sparrow.example_message.backpack.req.ReqBackPackUseGoods();
        
        

        
        try {
            boolean done = false;
            Codec codec = null;
            while (!done) {
                int tag = input.readTag();
                if (tag == 0) {
                    break;
                }
                
                if (tag == 8) {
                    
                    ret.setGoodsId(input.readInt64())
;

                    
                    
                    continue;
                }
                
                
                if (tag == 16) {
                    
                    ret.setNum(input.readInt32())
;

                    
                    
                    continue;
                }
                
                               
                
                input.skipField(tag);
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e;
        } catch (java.io.IOException e) {
            throw e;
        }

        return ret;       
        
    } 
 
 
     public com.google.protobuf.Descriptors.Descriptor getDescriptor() throws IOException {
        if (this.descriptor != null) {
            return this.descriptor;
        }
        com.google.protobuf.Descriptors.Descriptor descriptor =
                CodedConstant.getDescriptor(com.sparrow.example_message.backpack.req.ReqBackPackUseGoods.class);
        return (this.descriptor = descriptor);
    }   
}

    